#include "interface.h"
#define vw2sb(P) QObject::connect(ui.viewport, SIGNAL(changedP##P (int)), ui.sbP##P , SLOT(setValue(int)));
#define sb2vw(P) QObject::connect(ui.sbP##P , SIGNAL(valueChanged(int)), ui.viewport, SLOT(changeP##P (int)));
#define vw2sbN(PP) vw2sb(X##PP)vw2sb(Y##PP)vw2sb(Z##PP)
#define sb2vwN(PP) sb2vw(X##PP)sb2vw(Y##PP)sb2vw(Z##PP)
#define vw2sbAll vw2sbN(0)vw2sbN(1)vw2sbN(2)vw2sbN(3)vw2sbN(4)vw2sbN(5)vw2sbN(6)vw2sbN(7)
#define sb2vwAll sb2vwN(0)sb2vwN(1)sb2vwN(2)sb2vwN(3)sb2vwN(4)sb2vwN(5)sb2vwN(6)sb2vwN(7)

Interface::Interface(QWidget *parent, Qt::WFlags flags, int argc, char** argv) : QMainWindow(parent, flags) {
	this->argc = argc;
	this->argv = argv;
	ui.setupUi(this);
	vw2sbAll;
	QObject::connect(ui.viewport, SIGNAL(changedP (int,int,int)), ui.previewfr, SLOT(changeP (int,int,int)));
	QObject::connect(ui.viewport, SIGNAL(changedPX0 (int)), ui.viewport, SLOT(changePX0 (int)));
	QObject::connect(ui.viewport, SIGNAL(status(QString)), ui.status, SLOT(setText(QString)));
	QObject::connect(ui.previewfr, SIGNAL(status(QString)), ui.status, SLOT(setText(QString)));
};